Adding some more judges, here and there.
[and.git] / COCI / 2009-2010 / Contest #7 - 24.04.2010 / cokolada / cokolada.cpp
blob940af42c95fa86da6a397f6c42fe28e4bab6a46b
1 #include <iostream>
2 #include <cassert>
4 #define D(x) cout << #x " = " << (x) << endl
5 using namespace std;
7 int main(){
8 int k;
9 cin >> k;
11 int p = 1;
12 while (p < k){
13 p <<= 1;
17 cout << p << " ";
19 int s = 1;
20 while (!(k & s)){
21 s <<= 1;
23 // s = smallest power of two in k
25 int ans = 0;
26 while (p > s){
27 p >>= 1;
28 ans++;
30 assert(p == s);
31 cout << ans << endl;
33 return 0;